package com.e2oto.seller.modules.seller.ui;


import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;

import com.e2oto.seller.R;
import com.e2oto.seller.common.base.BaseMvpFragment;
import com.e2oto.seller.modules.seller.adapter.OrderPageAdapter;
import com.e2oto.seller.modules.seller.presenter.OrderPresenter;
import com.e2oto.seller.modules.seller.views.OrderView;

import butterknife.BindView;


/**
 * Created by ZhangLiQiang on 2017/11/2.
 */

public class OrderFragment extends BaseMvpFragment<OrderView, OrderPresenter> implements OrderView {

    @BindView(R.id.order_tab_layout)
    TabLayout tabLayout;
    @BindView(R.id.order_vp)
    ViewPager viewPager;

    private OrderPageAdapter adapter;

    @Override
    protected int getContentView() {
        return R.layout.fragment_order;
    }

    @Override
    public OrderPresenter createPresenter() {
        return new OrderPresenter();
    }

    @Override
    public void showMessage(String msg) {

    }

    @Override
    protected void onFragmentFirstVisible() {
        super.onFragmentFirstVisible();

        adapter = new OrderPageAdapter(getFragmentManager());
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
    }
}
